<!--#include file="../nav/admin_top.php" -->
<style type="text/css">
table.mytable .mylabel{
width:300px;  
}
span.spans{
color:#333333;
margin-left:20px;
}
</style>
<div class="titleDiv">
	<div class="titleCaption">
		<span class="captionSpan">权限组管理</span>
		<span class="totalSpan"> <label id="captionNum"></label> </span>
	</div>
</div>
<div class="menuBg">
	<a class="menuAdd" href="{url::build('admin','authgroup_add')}">添加权限组</a> 
  <div style="clear:both"></div>
</div>
<div style="margin:10px auto">
	关键字：<input type="text" maxlength="12" id="keywords" class="searchs" /> 
	<input type="button"  onclick="fnSearchs()" value="查询"  />  	
</div> 
<div id="grids"></div> 
<script type="text/javascript">
var url_view = '/admin/authgroup_view';
var url_modify = '/admin/authgroup_modify';
var url_del = '/admin/authgroup_del';
$().ready(function(){
	o2js.build('jquery_cluetip');
	o2js.build('o2grid');
	showLoading();
	grids = new o2Grid({
		bind:'grids', 
		url:'/admin/authgroup_list',
		imgpath:'/misc/vendors/o2js/o2grid/image',
		cols:[
			{index:'id',mapping:'a.id', name:'序号', width:50,sortable:false, func:function(val,row_index,column_name,json,R){
				 return  '<span title="ID：'+json.id+'" >'+((R.page - 1)*R.rowNum + (row_index+1))+'</span>';
			}}, 
			{index:'name',mapping:'a.name', name:'权限组名称', width:250,func:function(val,row_index,column_name,json,R){
					return val;
				}
			},
			{index:'remark',mapping:'a.remark', name:'说明', width:400 
			},
			{index:'id',mapping:'a.id', name:'操作'	, width:200,sortable:false,func:function(val,row_index,column_name,json,R){
					return  ' <a href="'+url_view+'&id='+json.id+'" style="color: " rel="'+url_view+'?id='+json.id+'" class="showinfo" >权限预览</a> '+' <a href="'+url_modify+'?id='+json.id+'" style="color: "  ><img src="/misc/images/edit.gif" />  修改</a> '+' <a href="javascript:void(0)" onclick="fnDel('+json.id+')" ><img src="/misc/images/del.gif" /> 删除</a> ';
				}
			}
		],
		endfunc:function(obj){
			$('a.showinfo').cluetip({
				cluetipClass: 'jtip', 
				sticky: true,
				arrows: true, 
				dropShadow: false,
				closePosition: 'title',
				mouseOutClose: true,
				width:350,
				height:500
			}).each(function(){
				$(this).click(function(e){
					stopDefault(e);
				});
			}); 
		}
	});
	fnSearchs();	 
	$('#keywords').keypress(function(e){
		if(e.keyCode==13||e.keyCode==10){
			fnSearchs();
		}
	}); 
	
});  
function fnSearchsAll(){
	grids.setBaseParams({
		keywords:''
	}); 
	grids.load(1); 
}
function fnSearchs(){
	grids.setBaseParams({
		keywords:encodeURIComponent($('#keywords').val())
	}); 
	grids.load(1); 
} 
/* 删除 */
function fnDel(NId){
	fnConfirm({
		str:'确认删除本行数据?',
		func_true:function(){
			$('button').attr('disabled','disabled');
			$.post(
				url_del,
				{
					id:NId
				},
				function(e){
					var ok = errorHandler(e);
					if(ok && ok.success=='1'){
						window.location.reload();
					}
					$('button').attr('disabled','');
				}
			);
		}
	}); 
}
</script>
<!--#include file="../nav/admin_bottom.php" -->